<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
  	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>后台管理系统</title>
  	<link rel="stylesheet" href="/static/admin/layui/css/layui.css">
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
	  	<div class="layui-header">
	    	<div class="layui-logo">车行后台管理系统</div>
	    	<!-- 头部区域（可配合layui已有的水平导航） -->
	    	<ul class="layui-nav layui-layout-left">
		      	<li class="layui-nav-item"><a href="/admin/home" target="main" class="layui-icon layui-icon-home" title="首页"></a></li>
		      	<li class="layui-nav-item"><a href="javascript:;" class="layui-icon layui-icon-fonts-clear" title="清除缓存"></a></li>
	    	</ul>
	    	<ul class="layui-nav layui-layout-right">
		      	<li class="layui-nav-item">
			        <a href="javascript:;">
			          	<img src="http://t.cn/RCzsdCq" class="layui-nav-img">{:cookie('username')}
			        </a>
		      	</li>
	      		<li class="layui-nav-item"><a href="javascript:;" class="loginout">退出</a></li>
	    	</ul>
	  	</div>
  
  		<div class="layui-side layui-bg-black">
	    	<div class="layui-side-scroll">
		      	<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
		      	<ul class="layui-nav layui-nav-tree"  lay-filter="test">
			        <li class="layui-nav-item layui-nav-itemed">
			          	<a class="" href="javascript:;">基础设置</a>
			          	<dl class="layui-nav-child">
				            <dd><a href="system/index" target="main">系统设置</a></dd>
			          	</dl>
		        	</li>
		        	<li class="layui-nav-item">
						<a href="javascript:;">管理员管理</a>
			          	<dl class="layui-nav-child">
				            <dd><a href="admin/index" target="main">管理员列表</a></dd>
			          	</dl>
			        </li>
		        	<li class="layui-nav-item">
						<a href="javascript:;">会员管理</a>
			          	<dl class="layui-nav-child">
				            <dd><a href="user/index" target="main">会员列表</a></dd>
			          	</dl>
			        </li>
			        <li class="layui-nav-item">
						<a href="javascript:;">广告管理</a>
			          	<dl class="layui-nav-child">
				            <dd><a href="advert/index" target="main">广告列表</a></dd>
			          	</dl>
			        </li>
		        	<li class="layui-nav-item">
			          	<a href="javascript:;">发布管理</a>
			          	<dl class="layui-nav-child">
				            <dd><a href="car/index" target="main">发布列表</a></dd>
				            <dd><a href="carModel/index" target="main">车型列表</a></dd>
				            <dd><a href="carBrand/index" target="main">品牌列表</a></dd>
			          	</dl>
		        	</li>
			        <li class="layui-nav-item">
						<a href="javascript:;">意见反馈管理</a>
			          	<dl class="layui-nav-child">
				            <dd><a href="feedback/index" target="main">意见反馈列表</a></dd>
			          	</dl>
			        </li>
			        <li class="layui-nav-item"><a href="">客服</a></li>
		      	</ul>
    		</div>
  		</div>
  
  		<div class="layui-body">
	    	<!-- 内容主体区域 -->
	    	<iframe src="/admin/home" name="main" width="100%" height="100%" style="border:none;display:block;"></iframe>
  		</div>
  		<div class="layui-footer">
		    <!-- 底部固定区域 -->
		    © www.chehang.com - 车行版权所有
  		</div>
	</div>
	<script src="/static/admin/layui/layui.js"></script>
	<script src="/static/admin/layui/layui.all.js"></script>
	<script src="/static/admin/js/public.js"></script>
	<script>
		//JavaScript代码区域
		layui.use('element', function(){
		  	var element = layui.element;
		  	var $ = layui.jquery;

		  	/*清除缓存*/
		  	$('.layui-icon-fonts-clear').click(function(event) {
		  		$.ajax({
		            url: '/admin/clearcache',
		            type: 'post',
		            success: function (ret) {
		                if (ret.code == 1) {
	                        showMsg(ret.msg,{icon:1});
	                    } else {
	                        showMsg(ret.msg,{icon:2});
	                        return false;
	                    }
		            },
		            error: function (err) {
		                console.log(err)
		            }
		        });
		  	});

		  	/*退出*/
		  	$('.loginout').click(function(event) {
		  		$.ajax({
		            url: '/admin/loginout',
		            type: 'post',
		            success: function (ret) {
		                if (ret.code == 1) {
	                        showMsg(ret.msg,{icon:1});
	                        setTimeout(function(){
	                        	location.href = "/admin";
	                        },1000);
	                    } else {
	                        showMsg(ret.msg,{icon:2});
	                        return false;
	                    }
		            },
		            error: function (err) {
		                console.log(err)
		            }
		        });
		  	});
		});
	</script>
</body>
</html>